#include "animationmanager.hpp"

AnimationManager::AnimationManager()
{
    currentAnimation = NULL;
    previousAnimation = NULL;
}

AnimationManager::~AnimationManager()
{
    this->animations.clear();
}

void AnimationManager::Add(Animation animation)
{
    this->animations.push_back(animation);
    currentAnimation = &animations.front();
}

void AnimationManager::ChangeAnimation(int index)
{
    this->previousAnimation = this->currentAnimation;
    this->currentAnimation = &this->animations.at(index);
}

Rect AnimationManager::GetNextAnimation()
{
    Rect temp = this->currentAnimation->Next();
    return temp;
}
